<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>
            公告列表删除恢复
        </title>
        <meta name="renderer" content="webkit">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="format-detection" content="telephone=no">

        <link rel="stylesheet" href="/static/css/x-admin.css" media="all">
        <link rel="stylesheet" href="/static/lib//layui/css/layui.css">
    </head>
    <body>
        <div class="x-nav">
            <span class="layui-breadcrumb">
              <a><cite>首页</cite></a>
              <a><cite>招标列表</cite></a>
              <a><cite>恢复类目</cite></a>
            </span>
            <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right"  href="javascript:location.replace(location.href);" title="刷新"><i class="layui-icon" style="line-height:30px">ဂ</i></a>
        </div>
<!--        <div class="x-body">-->
            {if condition="$info eq null"}
            <blockquote class="layui-elem-quote">暂无删除的采购</blockquote>
            {else}
            <xblock style="height: 30px">
                <span class="x-right" style="line-height:30px;margin-right: 15px">共有数据：<span class="layui-badge">{$count}</span> 条</span>
            </xblock>
            <table class="layui-table">
                <thead>
                <tr>
                    <th>
                        ID
                    </th>
                    <th>
                        类目列表
                    </th>
                    <th>
                        上级分类
                    </th>
                    <th>
                        操作
                    </th>
                </tr>
                </thead>
                <tbody>
                    {foreach name="info" id="v"}
                    <tr>
                        <td>
                            {$v.id}
                        </td>

                        <td>
                            {$v.name}
                        </td>
                        <td>
                            {if condition="$v.pid==0"}
                            顶级
                            {/if}
                            {if condition="$v.pid!=0"}

                            {$v.pid}
                            {/if}
                        </td>
                        <td class="td-manage">
                            <a title="恢复" href="javascript:;" onclick="member_del('{$v.id}','{$v.delete}')"
                               style="text-decoration:none">
                                <i class="layui-icon">&#xe857;</i>
                            </a>
                        </td>
                    </tr>
                    {/foreach}
                </tbody>
            </table>
            {/if}
<!--        </div>-->
        <script src="/static/lib/layui/layui.js" charset="utf-8"></script>
        <script src="/static/js/x-layui.js" charset="utf-8"></script>
        <script>
            layui.use(['element','layer','form'], function(){
                $ = layui.jquery;//jquery
              lement = layui.element();//面包导航
              layer = layui.layer;//弹出层
              form = layui.form();
            })

            function member_del(id,obj) {
                layer.confirm('确定要恢复该采购吗？',{icon:3,title:'提示信息'},function(index){
                    $.ajax({
                        url:"{:url('leimu_huifude')}",
                        data:{id:id,delete:obj},
                        type:'post',
                        success:function (res) {
                            if (res.code == 100){
                                layer.msg(res.msg, {icon: 6,time:2000},function () {
                                    window.parent.location.reload();
                                    var index = parent.layer.getFrameIndex(window.name);
                                    parent.layer.close(index);
                                });
                                return false;
                            }else{
                                layer.msg(res.msg,{icon:7,time:1000});
                                return false;
                            }
                        }
                    })
                });
            }
        </script>
            
    </body>
</html>